package com.exmaple.taskreminder;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.FragmentActivity;

public class ReminderAddEditActivity extends FragmentActivity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.reminder_add_edit_activity);
		Fragment fragment = getSupportFragmentManager().findFragmentByTag(ReminderAddEditFragment.DEFAULT_EDIT_FRAGMENT_TAG);
		if (fragment == null) {
			fragment = new ReminderAddEditFragment();
			Bundle args = new Bundle();
			args.putLong(ReminderProvider.COLUMN_ROWID, getIntent().getLongExtra(ReminderProvider.COLUMN_ROWID, 0L));
			fragment.setArguments(args);
			FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
			transaction.add(R.id.edit_container, fragment, ReminderAddEditFragment.DEFAULT_EDIT_FRAGMENT_TAG);
			transaction.commit();
			
		}
	}
}
